import java.util.Scanner;

public class Protice09 {
    public static void main(String[] args) {
        //9. 在唱歌比赛中，有6名评委给选手打分，分数范围是[0 - 100]之间的整数。选手的
        //最后得分为：去掉最高分、最低分后的4个评委的平均分，请完成上述过程并计算
        //出选手的得分。
        double[] score = new double[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 6; i++) {
            System.out.println("请输入第" + i + "位评委的成绩：");
            score[i] = sc.nextDouble();
        }
        double max = score[0];
        double min = score[0];
        double sum = 0;
        double avg = 0;
        int a = 0;
        int b = 0;
        for (int i = 0; i < 6; i++) {
            if (score[i] > max) {
                max = score[i];
                a = i;
            }
        }
        System.out.println("去掉最高分：" + max);
        for (int i = 0; i < 6; i++) {
            if (score[i] < min) {
                min = score[i];
                b = i;
            }
        }
        System.out.println("去掉最低分：" +min);
        score[a] = 0;
        score[b] = 0;
        for (int i = 0; i <6 ;i++){
            sum +=score[i];
        }
        System.out.println("总分为：" + sum);
        avg = sum / 4;
        System.out.println("平均分为：" +  avg);

    }
}
